// Application constants

// Video formats
export const VIDEO_FORMATS = [
  { value: 'mp4', label: 'MP4', extension: '.mp4' },
  { value: 'avi', label: 'AVI', extension: '.avi' },
  { value: 'mov', label: 'MOV', extension: '.mov' },
  { value: 'mkv', label: 'MKV', extension: '.mkv' },
  { value: 'wmv', label: 'WMV', extension: '.wmv' },
  { value: 'flv', label: 'FLV', extension: '.flv' },
  { value: 'webm', label: 'WebM', extension: '.webm' },
  { value: '3gp', label: '3GP', extension: '.3gp' },
] as const;

// Audio formats
export const AUDIO_FORMATS = [
  { value: 'mp3', label: 'MP3', extension: '.mp3' },
  { value: 'wav', label: 'WAV', extension: '.wav' },
  { value: 'aac', label: 'AAC', extension: '.aac' },
  { value: 'flac', label: 'FLAC', extension: '.flac' },
  { value: 'ogg', label: 'OGG', extension: '.ogg' },
  { value: 'm4a', label: 'M4A', extension: '.m4a' },
] as const;

// Quality presets
export const QUALITY_PRESETS = [
  { value: 'low', label: '低质量 (快速)', bitrate: 500 },
  { value: 'medium', label: '中等质量', bitrate: 1500 },
  { value: 'high', label: '高质量', bitrate: 3000 },
  { value: 'lossless', label: '无损质量', bitrate: -1 },
] as const;

// Common resolutions
export const RESOLUTIONS = [
  { value: '480p', label: '480p (640x480)', width: 640, height: 480 },
  { value: '720p', label: '720p (1280x720)', width: 1280, height: 720 },
  { value: '1080p', label: '1080p (1920x1080)', width: 1920, height: 1080 },
  { value: '1440p', label: '1440p (2560x1440)', width: 2560, height: 1440 },
  { value: '4k', label: '4K (3840x2160)', width: 3840, height: 2160 },
  { value: 'custom', label: '自定义', width: 0, height: 0 },
] as const;

// Frame rates
export const FRAME_RATES = [
  { value: 24, label: '24 fps' },
  { value: 25, label: '25 fps' },
  { value: 30, label: '30 fps' },
  { value: 50, label: '50 fps' },
  { value: 60, label: '60 fps' },
] as const;

// File size limits (in bytes)
export const FILE_SIZE_LIMITS = {
  FREE_TIER: 100 * 1024 * 1024, // 100MB
  BASIC_TIER: 1024 * 1024 * 1024, // 1GB
  PRO_TIER: 5 * 1024 * 1024 * 1024, // 5GB
  ENTERPRISE_TIER: -1, // Unlimited
} as const;

// Task statuses
export const TASK_STATUSES = {
  PENDING: 'pending',
  QUEUED: 'queued',
  PROCESSING: 'processing',
  COMPLETED: 'completed',
  FAILED: 'failed',
  CANCELED: 'canceled',
  PAUSED: 'paused',
} as const;

// Notification types
export const NOTIFICATION_TYPES = {
  SUCCESS: 'success',
  ERROR: 'error',
  WARNING: 'warning',
  INFO: 'info',
} as const;

// Theme options
export const THEMES = {
  LIGHT: 'light',
  DARK: 'dark',
  SYSTEM: 'system',
} as const;

// User roles
export const USER_ROLES = {
  USER: 'user',
  ADMIN: 'admin',
  MODERATOR: 'moderator',
} as const;

// Subscription plans
export const SUBSCRIPTION_PLANS = {
  FREE: 'free',
  BASIC: 'basic',
  PRO: 'pro',
  ENTERPRISE: 'enterprise',
} as const;

// Local storage keys
export const STORAGE_KEYS = {
  AUTH_TOKEN: 'auth_token',
  USER_PREFERENCES: 'user_preferences',
  RECENT_FILES: 'recent_files',
  SETTINGS: 'settings',
  THEME: 'theme',
} as const;

// API endpoints (for reference)
export const API_ENDPOINTS = {
  // Auth
  LOGIN: 'auth_login',
  REGISTER: 'auth_register',
  LOGOUT: 'auth_logout',
  GET_USER: 'auth_get_current_user',

  // Video processing
  SELECT_FILES: 'video_select_files',
  GET_VIDEO_INFO: 'video_get_info',
  PROCESS_VIDEO: 'video_process',
  BATCH_PROCESS: 'video_batch_process',
  CANCEL_TASK: 'video_cancel_task',

  // Settings
  GET_SETTING: 'settings_get',
  SET_SETTING: 'settings_set',
  GET_ALL_SETTINGS: 'settings_get_all',

  // System
  GET_SYSTEM_INFO: 'system_get_info',
  CHECK_FFMPEG: 'system_check_ffmpeg',
} as const;

// Error codes
export const ERROR_CODES = {
  // Auth errors
  INVALID_CREDENTIALS: 'INVALID_CREDENTIALS',
  USER_NOT_FOUND: 'USER_NOT_FOUND',
  EMAIL_ALREADY_EXISTS: 'EMAIL_ALREADY_EXISTS',

  // Video processing errors
  FILE_NOT_FOUND: 'FILE_NOT_FOUND',
  INVALID_FORMAT: 'INVALID_FORMAT',
  PROCESSING_FAILED: 'PROCESSING_FAILED',
  INSUFFICIENT_SPACE: 'INSUFFICIENT_SPACE',

  // System errors
  FFMPEG_NOT_FOUND: 'FFMPEG_NOT_FOUND',
  PERMISSION_DENIED: 'PERMISSION_DENIED',
  UNKNOWN_ERROR: 'UNKNOWN_ERROR',
} as const;

// Default settings
export const DEFAULT_SETTINGS = {
  theme: THEMES.SYSTEM,
  language: 'zh-CN',
  autoSave: true,
  defaultOutputFormat: 'mp4',
  defaultQuality: 'high',
  maxConcurrentTasks: 2,
  enableNotifications: true,
  enableHardwareAcceleration: true,
} as const;

// File naming patterns
export const FILE_NAMING_PATTERNS = [
  { value: '{name}_processed.{ext}', label: '原文件名_processed.扩展名' },
  { value: '{name}_{timestamp}.{ext}', label: '原文件名_时间戳.扩展名' },
  { value: '{name}_{counter}.{ext}', label: '原文件名_序号.扩展名' },
  { value: 'processed_{name}.{ext}', label: 'processed_原文件名.扩展名' },
  { value: '{name}_{format}.{ext}', label: '原文件名_格式.扩展名' },
] as const;

// Animation durations
export const ANIMATION_DURATIONS = {
  FAST: 150,
  NORMAL: 300,
  SLOW: 500,
} as const;

// Breakpoints
export const BREAKPOINTS = {
  XS: 475,
  SM: 640,
  MD: 768,
  LG: 1024,
  XL: 1280,
  '2XL': 1536,
} as const;
